package com.servcice.impl;

import com.dao.GenChartDao;
import com.dto.BaseDto;
import com.dto.dataenum.MessageEnum;
import com.servcice.GenChartService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.lang.reflect.InvocationTargetException;
import java.util.List;
import java.util.Map;
import java.util.Optional;

@Service
public class GenChartServiceImpl implements GenChartService {
    @Resource
    GenChartDao genChartDao;
    public BaseDto getDataSet(String methodname) throws InvocationTargetException, IllegalAccessException{
        List<Map> listMap = genChartDao.getDataSet(methodname);
        MessageEnum messageEnum = listMap.size()>0?MessageEnum.SELECT_DATASET_SUCCESS:MessageEnum.SELECT_DATASET_FAIL;
        return new BaseDto(messageEnum,listMap);
    }
}
